# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-py-cpuinfo
_pkgname=py-cpuinfo
pkgver=9.0.0
pkgrel=4
pkgdesc="Pure-Python module for getting CPU info"
url="https://github.com/workhorsy/py-cpuinfo"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	py-cpuinfo-loongarch64.patch
	disable-test-from-proc-cpuinfo.patch
	"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-cpuinfo" # Backwards compatibility
provides="py-cpuinfo=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m unittest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/py_cpu*.whl
}

sha512sums="
c7711137d60ad52bcbef8738a70fb48ceaa69e1e1632d135d0ee95c282b02df6170c3dd88a1e14b3e9a386d3286a15ca9722fcfb596107da022161a7cf84509a  py-cpuinfo-9.0.0.tar.gz
87e8d952c4aeee459f28abc75ce4a7fb6557053160b2d29afe28cfc05d922f4f550cc93757c4fbfd47b98e3f0447383a7a3609d982713970c482e2d4e490372e  py-cpuinfo-loongarch64.patch
37b1835d2817d71abd769989feca95fcc2652e2b257165951f942ca6fa49ceee6b24c82e372db4b9087b665fd22d52ab83f5dec1b303386e8cd0d972d0f02481  disable-test-from-proc-cpuinfo.patch
"
